home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Editors / emacs / Emacs-1.14b1 / lisp / mac / Palettes.el < prev    next >
Encoding:
Text File  |  1994-02-20  |  3.6 KB  |  145 lines  |  [TEXT/EMAC]

  1. ;;;
  2. ;;; This file is part of a Macintosh port of GNU Emacs.
  3. ;;;
  4. ;;; GNU Emacs is distributed in the hope that it will be useful,
  5. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  6. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  7. ;;; GNU General Public License for more details.
  8. ;;;
  9.  
  10. (defconst pmCouteous 0)
  11. (defconst pmTolerant 2)
  12. (defconst pmAnimated 4)
  13. (defconst pmExplicit 8)
  14.  
  15. (defconst pmNoUpdates (hex-string-to-int "8000"))
  16. (defconst pmBkUpdates (hex-string-to-int "a000"))
  17. (defconst pmFgUpdates (hex-string-to-int "c000"))
  18. (defconst pmAllUpdates (hex-string-to-int "e000"))
  19.  
  20. (c:defstruct ColorInfo ((RGBColor ciRGB)
  21.                         (short ciUsage)
  22.                         (short ciTolerance)
  23.                         ((array short 3) ciDataFields)))
  24.  
  25. (c:defstruct Palette ((short pmEntries)
  26.                       ((array short 7) pmDataFields)
  27.                       ((array ColorInfo 1) pmInfo)))
  28.  
  29. (c:typedef PalettePtr (ptr . Palette))
  30. (c:typedef PaletteHandle (ptr ptr . Palette))
  31.  
  32. ; pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
  33. ;  short srcTolerance)
  34. ;  = 0xAA91; 
  35. (deftrap NewPalette ("aa91")
  36.   ((entries short)
  37.    (srcColors long)
  38.    (srcUsage short)
  39.    (srcTolerance short))
  40.   long)
  41.  
  42. ; pascal void DisposePalette(PaletteHandle srcPalette)
  43. ;  = 0xAA93; 
  44. (deftrap DisposePalette ("aa93")
  45.   ((srcPalette long))
  46.   nil)
  47.  
  48. ; pascal void ActivatePalette(WindowPtr srcWindow)
  49. ;  = 0xAA94; 
  50. (deftrap ActivatePalette ("aa94")
  51.   ((srcWindow long))
  52.   nil)
  53.  
  54. ; pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  55. ;  = 0xAA96; 
  56. (deftrap GetPalette ("aa96")
  57.   ((srcWindow address))
  58.   long)
  59.  
  60. ; pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
  61. ;  short srcEntry,short dstEntry,short dstLength)
  62. ;  = 0xAAA1; 
  63. (deftrap CopyPalette ("aaa1")
  64.   ((srcPalette long)
  65.    (dstPalette long)
  66.    (srcEntry short)
  67.    (dstEntry short)
  68.    (dstLength short))
  69.   nil)
  70.  
  71. ; pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
  72. ;  = 0xAA95; 
  73. (deftrap SetPalette ("aa95")
  74.   ((dstWindow long)
  75.    (srcPalette long)
  76.    (cUpdates char))
  77.   nil)
  78.  
  79. ; pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor *dstRGB)
  80. ;  = 0xAA9B; 
  81. (deftrap GetEntryColor ("aa9b")
  82.   ((srcPalette long)
  83.    (srcEntry short)
  84.    (dstRGB address))
  85.   nil)
  86.  
  87. ; pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor *srcRGB)
  88. ;  = 0xAA9C; 
  89. (deftrap SetEntryColor ("aa9c")
  90.   ((dstPalette long)
  91.    (dstEntry short)
  92.    (srcRGB address))
  93.   nil)
  94.  
  95. ; pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
  96. ;  = 0xAA95; 
  97. (deftrap NSetPalette ("aa95")
  98.   ((dstWindow long)
  99.    (srcPalette long)
  100.    (nCUpdates short))
  101.   nil)
  102.  
  103. ; pascal void PmForeColor(short dstEntry)
  104. ;  = 0xAA97; 
  105. (deftrap PmForeColor ("aa97")
  106.   ((dstEntry short))
  107.   nil)
  108.  
  109. ; pascal void PmBackColor(short dstEntry)
  110. ;  = 0xAA98; 
  111. (deftrap PmBackColor ("aa98")
  112.   ((dstEntry short))
  113.   nil)
  114.  
  115. ; pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
  116. ;  short srcTolerance)
  117. ; = 0xAA9E; 
  118. (deftrap SetEntryUsage ("aa9e")
  119.   ((dstPalette long)
  120.    (dstEntry short)
  121.    (srcUsage short)
  122.    (srcTolerance short))
  123.   nil)
  124.  
  125. ; pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor *srcRGB)
  126. ;  = 0xAA99; 
  127. (deftrap AnimateEntry ("aa99")
  128.   ((dstWindow long)
  129.    (dstEntry short)
  130.    (srcRGB address))
  131.   nil)
  132.  
  133. ; pascal void ResizePalette(PaletteHandle p,short size)
  134. ; = {0x7003,0xAAA2}; 
  135. (deftrap ResizePalette ("7003" "aaa2")
  136.   ((p long)
  137.    (size short))
  138.   nil)
  139.  
  140. ; pascal PaletteHandle GetNewPalette(short PaletteID)
  141. ;  = 0xAA92; 
  142. (deftrap GetNewPalette ("aa92")
  143.   ((PaletteID short))
  144.   long)
  145.